﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Liju.Common
{
    public class TableLayoutPanelHelper
    {
        /// <summary>
        /// 设置TableLayoutPanel指定行的高度
        /// </summary>
        /// <param name="layout">TableLayoutPanel</param>
        /// <param name="row">行号</param>
        /// <returns>行高</returns>
        public static void SetTableLayoutRowHeight(TableLayoutPanel layout, int row, float height)
        {
            int count = layout.RowCount;
            if (row > count) return;

            for (int i = 0; i <= count; i++)
            {
                if (i == row)
                {
                    layout.RowStyles[i].Height = height;
                    return;
                }
            }
        }
    }
}
